The present invention relates to a n image processor and an image processing method for computer graphics.
In the field of computer graphics, to realize a higher capability of image processing, there has been known a method of processing by which a screen is divided into tiny rectangular regions (hereinafter referred to as xe2x80x9cfragmentsxe2x80x9d) and processing is done fragment by fragment.
This conventional method will now be described with reference to FIGS. 14 to 17, wherein, at first, (1): each polygon is divided by frames of fragments and memorized with the fragments containing the polygons known.
In FIG. 14, there are fifteen fragments arranged in a matrix of 3xc3x975, on which polygons A, R and C are defined. Concerning the polygon A, it corresponds to eight fragments, as shown in FIG. 15. These fragments are stored in a buffer memory shown in FIG. 16 according to their coordinates xcex1, xcex2, xcex3, etc. xcex11 and xcex12 in FIG. 15 are stored in the memory area xcex1 of the buffer memory, xcex21 and xcex22 in FIG. 15 are stored in the memory area xcex2 of the buffer memory, and xcex31 and xcex32 in FIG. 15 are stored in the memory area xcex3 of the buffer memory. The same is applied to the remaining coordinates.
(2): Next, of all the fragments, fragments covered by a polygon currently concerned are computed and painted. For example, as shown in FIG. 17, a fragment xcex41 is first painted toward the polygon A (see FIG. 17(b)), painted toward the polygon B (see FIG. 17(c)), and finally painted toward the polygon C (see FIG. 17(d)). Such operation is repeated until the final polygon is processed or the fragment is totally covered. And the forgoing processing is performed for all the fragments.
The conventional data processing of image elements has been performed on the foregoing procedures (1) and (2).
However, such method requires all the polygons to be divided every objective fragment, resulting in that a huge amount of calculation is necessary and a long processing time is also required.
Additionally, there arise various drawbacks. For example, a storage of a greater capacity should be arranged to memorize information about polygons which have been divided to be produced. In order to gain faster processing, the storage should be faster in operation, raising cost for the storage.
Moreover, in cases semitransparent polygons possess texture data, they can be processed on the conventional method.
The present invention has been done for resolving the foregoing problems, and an object of the present invention is to enable processing of data of image elements to be performed efficiently and fast in computer graphic systems and to obtain higher-quality images at a lower cost than conventional. One method to realize such object is that a screen is divided into tiny regions (fragments) for processing. In this case, an object is to efficiently retrieve polygons included in regions concerned. To be brief, in computer graphic systems, there are provided a system and a method that provide images of higher quality at a lower cost than the conventional systems.
An image processor according to the present invention is an image processor, in which a screen is divided into regions of a predetermined size and processing is performed every divided region, comprising first rearranging means for rearranging pieces of information on image constituting elements in a direction vertical to a scanning line, second rearranging means for rearranging the pieces of information on the image constituting elements in a horizontal direction to the scanning direction, and an image processing unit performing image processing on the basis of the rearranged pieces of information on the image constituting elements.
In the image processor of the present invention, the first rearranging means perform the rearrangement based on minimum or maximum values of the image constituting elements concerning the vertical direction and the second rearranging means perform the rearrangement based on minimum or maximum values of the image constituting elements concerning the horizontal direction, among vertical coordinates of a region to be processed by the first rearranging means.
It may be accepted that the rearrangement is performed either by minimums or maximums. Even when keys by which the rearrangement is performed are maximums, it is enough that only the directions in the order of processing are changed (xe2x80x9cleft to right sidesxe2x80x9d to xe2x80x9cright to left sidesxe2x80x9d or xe2x80x9cupper to lower sidesxe2x80x9d to xe2x80x9clower to upper sidesxe2x80x9d), that is, the similar processing being able to be employed. Even if the order is either vertical to horizontal sides or horizontal to vertical sides, the similar processing can be used.
In the image processor of the present invention, the first and second rearranging means perform link processing which mutually links the rearranged pieces of information on the image constituting elements.
In the image processor according to the present invention, the first and second rearranging means perform link update processing which invalidates ones unnecessary within the regions corresponding to the image constituting elements.
In the image processor of the present invention, the image processing unit not only sections, as to image processing for each divided region, objectives to be processed into opaque polygons, polygons with transparent pixels, and semitransparent polygons but also processes in the order of the opaque polygons, polygons with transparent pixels, and semitransparent polygons.
The image processing method according to the present invention provides a method, which allows a screen to be divided into regions of a predetermined size and processing to be done every divided region, has a first rearranging step of rearranging pieces of information on image constituting elements in a vertical direction to a scanning line, a second rearranging step of rearranging the pieces of information on the image constituting elements in a horizontal direction to the scanning line, and an image processing step of performing image processing on the basis of the rearranged pieces of information of the image constituting elements.
According to the image processing method of the present invention, in the first rearranging step, its rearrangement is performed on a minimum value of the image constituting elements with regard to the vertical direction, and in the second rearranging step, its rearrangement is performed on a minimum value of the image constituting elements with regard to the horizontal direction, among vertical coordinates of a region to be processed in the first rearranging step.
According to the image processing method of the present invention, in the first and second rearranging steps, link processing is performed to mutually link the rearranged pieces of information on the image constituting elements.
According to the image processing method of the present invention, in the first and second rearranging steps, link update processing is performed to invalidate unnecessary ones among the regions corresponding to the image constituting elements.
According to the image processing method of the present invention, in the image processing step, the image processing for each divided region is performed with objectives to be processed sectioned into opaque polygons, polygons with transparent pixels, and semitransparent polygons, and performed in the order of the opaque polygons, polygons with transparent pixels, and semitransparent polygons.